home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
opint102.5rc
/
OPINT.DOC
< prev
next >
Wrap
Text File
|
1988-12-04
|
55KB
|
2,001 lines
Opus System file interface Version 1.02 Nov 23, 1988
O P I N T
By
Per Holm.
The Opus Sytem File Interface.
And
Fossil Interface
A Turbo Pascal 4.0 unit.
Or
A Turbo Pascal 5.0 unit.
Opus System file interface Version 1.02 Nov 23, 1988
WHAT IS OPINT ?
OpInt is an interface to read and write most of the OPUS system files.
OpInt v1.02 - OPus system file INTerface.
COPYRIGHT (C) 1988 Bifrost Unlimited, all rights reserved.
OpInt V 1.02 is not public domain.
But you are granted a limited license to use OpInt under the
following conditions.
- OpInt may not be used in commercial environments without
written permission from Bifrost Unlimited & Per Holm.
- You may use the OpInt interface as long as Credits are given
to the Author of OpInt and WW3.
- If you write a Postcard to the author. (it will only cost
you a single postcard and a stamp).
- OpInt may not be modified in any way.
- You may give a copy and distribute OpInt as long as no fee
are charged (this includes compensation for diskettes).
- OpInt V1.02 must be copied in unmodified form, complete with
the following files in the archive OpInt102.?RC:
OpInt.TPU : The TPAS 4.0 or 5.0 Unit
OpInt.TXT : Short Description about the use of OpInt.
OpInt.DOC : This lousy documentation.
Demo.PAS : A sample demo Program.
D_Com1.PAS : A sample demo for the communication Section.
D_Com2.PAS : A sample demo for the communication section.
D_Msg.PAS : A sample demo for the message section.
D_Nodel.PAS : A sample demo for the nodelist section.
D_User.PAS : A sample demo for the user section.
Read.Me : Short info from the author.
where Opint102.ARC will be the Turbo Pascal 4.00 version
and Opint102.5RC will be the Turbo Pascal 5.00 version..
The OpInt Unit was written to make it a little easier to write Turbo
Pascal utilities for the OPUS <tm> CBCS system.
Per Holm and Bifrost Unlimited gives you no garanties for the use of
this package, and the programs using it.
Please report any bugs and sugestions for new routines to the authors
and feel free to send code with your favorite routines.
As soon as we get hold on the file structures for OPUS Ver. 1.10 the
interface will be rewritten for these new file structures.
Opus System file interface Version 1.02 Nov 23, 1988
And Now some Credits.
Thanx to
Wynn Wagner III and the OPUS crew for the OPUS package.
Vince Perriello & Bob Hartman for Binkley.
Bob Hartman for Confmail and a lot more.
Kristian Ottosen (2:505/20 Closed) for Hints, Help and Support.
Jesper Wolf (2:230/10.1) for more Hints.
All those writing BBS software/shareware and utils for dooing it.
Please use the inteface in a frienly matter.
The Beta Tester Crew was:
Peter Kjoege (2:34/7)
Mik Tuver (2:230/22.24)
Lars Halling (2:230/30.5)
Soren Ager (2:231/12)
Morten Nielsen (2:231/33)
Johnny Odgaard (2:231/34)
Jesper Larsen (2:231/47)
Regards
Per Holm
Internet: perholm@daimi.DK
FidoNet: Per Holm - 2:230/22 (+45 6 119 043) (#CM: 24 Hrs)
MAIL: Per Holm
Risdalsvej 44,v1.
DK-8260 Viby J.
Denmark.
Opus System file interface Version 1.02 Nov 23, 1988
The OpInt unit includes procedures an functions meant to make it easier to
write utility programs for OPUS <tm> Version 1.03.
The package includes procedures and functions to read and write the
following files :
OPUS.PRM : The compiled control file for OPUS <tm> v 1.03.
USER.BBS : The file containing all users on your board.
LASTUSER.BBS : File created when using external program from OPUS.
SYSTEM??.BBS : The area description files.
SCHED.BBS : The schedule file.
NODELIST.IDX : The nodelist index file.
NODELIST.SYS : The nodelist file for the version 5 nodelist.
NODELIST.DAT : The nodelist file for the version 6 nodelist.
*.MSG : Messages..
The structures contained in this unit are:
_Sys : The contents of the SYSTEM??.BBS files.
_Usr : Structure to handle a user record.
_MsgArea : Structure used in _Usr.
_MsgHead : Structure to handle message headers.
_Msg : Structure to handle messages.
_Node : Pascal structure to handle ver. 5 nodelist records.
_NewNode : Pascal structure to handle ver. 6 nodelist records.
_Ndi : Pascal structure to handle nodelist index records.
_Prm : Structure to handle a version 14 opus parameter file.
_ClassRec : User Class structure.
_Sched : One entry in the schedule file.
_Scheds : All entries in a schedule file.
The structures will not be discussed in this document. For further
information you must read the file 'OPINT.TXT'.
The special variables in the OpInt unit are:
_Snoop : Enable/Disable the Snooping.
_Keyboard : Enable/Disable keyboard on Fossil.
_ExitCarrier : Errorlevel to exit program on carrier change.
_EightBit : Enable/Disable eight bit mode on input.
_ForceCom : Write to modem even if no carrier.
These variables will not be discussed in this document. For further
information you must read the file 'OPINT.TXT'.
Opus System file interface Version 1.02 Nov 23, 1988
The routines contained in the unit are:
MISC routines:
OpIntERROR : Return error codes from the OPINT interface.
UpperCase : Convert string to Uppercase.
Lowercase : Convert string to Lowercase.
SmartCase : Convert first letter in word to Uppercase.
Delay : A delay routine.
GetEnvStr : Return the settings of an environment variable.
GMT_Difference : Return the difference from GMT to local Time Zone.
DaysThisYear : Return the current daynumber this year.
GetDateTime : Return current time in DateTime Structure.
PackUnixDate : Pack Date and time to number of secs since 1-1-1970.
UnpackUnixDate : Decode the unix date.
PackDateStr : Pack time and date to a string.
UnpackDateStr : Decode a date string to DT variable.
PackDateStrLog : Convert DateTime to a log compatible date string.
AddLog : Add line to a Log File in OPUS format.
SetAttrib : Set/reset attribute flags...
The Prm file:
ReadPrm : Read a OPUS.PRM file.
WritePrm : Write a OPUS.PRM file.
The User file & Lastuser.BBS:
ReadUser : Read a user record from USER.BBS of LASTUSER.BBS.
WriteUser : Write a user record.
NumberOfUsers : Get the number of user-records in a userfile.
InitUserPtr : Make a buffer in memory for handling the User file.
ReadUserFast : Read a user record from the memory buffer.
WriteUserFast : Write a user record to the memory buffer.
ReleaseUserPtr : Delete memory buffer.
DelUserPtr : Delete a user record from the memory buffer.
InsUserPtr : Insert a user record into the memory buffer.
ReadUserFile : Read a Userfile from Disk to a memory buffer.
WriteUserFile : Write a memory buffer to a Diskfile.
The System??,BBS & Schedule files:
ReadSys : Read a SYSTEM??.BBS file.
WriteSys : Write a SYSTEM??.BBS file.
ReadScheds : Read a schedule file.
WriteScheds : Write a schedule file.
The Nodelist files:
ReadNdi : Read a nodelist index record.
WriteNdi : Write a nodelist index record.
ReadNode : Read a Nodelist record for ver. 5 nodelist
WriteNode : Write a Nodelist type 5 record.
ReadNewNode : Read a Nodelist type 6 record.
WriteNewNode : Write a Nodelist type 6 record.
NumberOfNodes : Return the number of nodes in a nodelist file.
FindNode : Find node entry number in a nodelist.
Opus System file interface Version 1.02 Nov 23, 1988
Messages:
MsgLength : Return the length in characters of message in memory.
FirstFreeMsg : Return name of the first free message in path.
ReadMsg : Read a message to memory.
WriteMsg : Write a message from memory to disk.
ReadMsgHead : Read Header part of message.
WriteMsgHead : Overwrite message head part of message on disk.
ReadMsgHeadNew : Read Header part of message.
WriteMsgHeadNew : Overwrite message head part of message on disk.
The communication routines contained in the unit are:
KeyPressed : Check for key Pressed at Stdin.
ReadKey : Read a charecter from StdIn (if any).
GotoXY : Move stdout cursor to a new position (ANSI).
PurgeInFossil : Clear the inputbuffer for a port used.
PurgeOutFossil : Clear the outputbuffer for the port used.
FossilCarrier : True if there is carrier on the port used.
FossilPressed : True if a user pressed a key.
GotoXYFossil : Change the users cursor position (ANSI).
ReadFossil : Read a character from the selected file.
AssignFossil : Assign a com. port to a textfile device driver.
SetSnoopFossil : Enable/disable snoop for a device.
SetKeyboardFossil: Enable/disable keyboard mode for a device.
SetExitFossil : Set exit code if carrier changes on device.
UseInOut : Redirect stdin & stdout to Text file device.
UnUseInOut : Restore stdin & stdout.
Opus System file interface Version 1.02 Nov 23, 1988
OpIntError Function
DESCRIPTION
This function will return a integer value that is the status of the
last opInt operation performed.
A call to OpIntError clears the internal error flag. Some of the other
functions and procedures in this package may reset the error flag too.
Depending which function or procedure you called last you may get one
of these error returns from the OpInt unit.
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
190 = Fossil is not loaded.
191 = Unable to find carrier.
192 = Carrier on current port has cahanged.
193 = Timeout reading port.
194 = Timeout writing port.
200 = .PRM file is to big ( > 8 KB )
201 = Wrong CTL file version, You need another OPUS_CTL
202 = To much data for the .PRM file ( > 8 KB )
210 = .MSG file is to big ( > 8 KB )
211 = To many lines in message
212 = To many charecters to write message
220 = Cannot find User record
221 = To Many Records In UserFile
222 = Not Room For Extra User Record in The Structure
230 = Cannot find Nodelist Record
231 = Cannot find Nodelist Index Record
250 = Illegal Date / Time specified.
SYNTAX
Function OpIntERROR: Integer;
Opus System file interface Version 1.02 Nov 23, 1988
UpperCase Function
DESCRIPTION
This function will convert a string to Uppercase.
SYNTAX
Function UpperCase(S:String):String;
EXAMPLES
Writeln(UpperCase('Per Holm @ 230/22 - Asgaard_BBS'));
Opus System file interface Version 1.02 Nov 23, 1988
LowerCase Function
DESCRIPTION
This function will convert a string to Lovercase.
SYNTAX
Function LoverCase(S:String):String;
EXAMPLES
Writeln(LoverCase('Per Holm @ 230/22 - Asgaard_BBS'));
Opus System file interface Version 1.02 Nov 23, 1988
SmartCase Function
DESCRIPTION
This function will convert a string so all words will start with an
uppercase charecter.
SYNTAX
Function SmartCase(S:String):String;
EXAMPLES
Writeln(SmartCase('Per Holm @ 230/22 - Asgaard_BBS'));
Opus System file interface Version 1.02 Nov 23, 1988
Delay Procedure
DESCRIPTION
This procedure will make a delay of ms milliseconds.
Like the one in the CRT Unit.
SYNTAX
Procedure Delay(MS: Word);
EXAMPLES
Delay(1000);
Opus System file interface Version 1.02 Nov 23, 1988
GetEnvStr Function
DESCRIPTION
This function will return an environment string, if it exist,
otherwise it will return an empty string. The name of the environt
variable is case sensitive which means 'TZ' and 'tz' are two different
variables.
SYNTAX
Function GetEnvStr(S:String):String;
EXAMPLES
Writeln(GetEnvStr('PATH'));
Opus System file interface Version 1.02 Nov 23, 1988
GMT_Difference Function
DESCRIPTION
This function will return an integer value with the TZ environment
variable.
SYNTAX
Function GMT_Difference:Integer;
EXAMPLE
Write('8.00 local time is equal to ',(8+GMT_Difference),'.00);
Opus System file interface Version 1.02 Nov 23, 1988
DaysThisYear Function
DESCRIPTION
Give day number for the date specified in DT.
Note that Year >= 1980.
SYNTAX
FUNCTION DaysThisYear(DT: DateTime):Integer;
ERROR RETURNS
250 = Illegal Date / Time specified.
EXAMPLES
...
WriteLn('Day Number: ',DaysThisYear(DT));
Opus System file interface Version 1.02 Nov 23, 1988
GetDateTime Procedure
DESCRIPTION
Get the system date and time to a variable of the type DateTime.
The Structure DateTime is defined in the Dos unit.
SYNTAX
Procedure GetDateTime(VAR DT:DateTime);
EXAMPLES
Uses Dos,Opint;
Var DT: DateTime;
Begin
GetDateTime(DT);
....
Opus System file interface Version 1.02 Nov 23, 1988
PackUnixDate Function
DESCRIPTION
Convert time and date to number of secconds since 1/1-1970 00:00:00.
Nice tool when calculating dates.
Note Year must be in the range 1980 - 2080.
SYNTAX
Function PackUnixDate(DT:DateTime):LongInt;
EXAMPLES
Write('Number of secs, since 1970',PackUnixDate(DT));
Opus System file interface Version 1.02 Nov 23, 1988
UnpackUnixDate Procedure
DESCRIPTION
Convert number of seconds since 1/1-1970 to DatTime format.
SYNTAX
Procedure UnpackUnixDate(Date:LongInt; Var DT:DateTime);
Opus System file interface Version 1.02 Nov 23, 1988
PackDateString Function
DESCRIPTION
Convert DateTime variable to a string of the format '24-May-88 12:22:21'
SYNTAX
Function PackDateString(DT:DateTime): String;
EXAMPLES
GetDateTime(DT);
Write(PackDateString(DT));
Opus System file interface Version 1.02 Nov 23, 1988
UnpackDateString Procedure
DESCRIPTION
This Procedure will return the contents of a Date/time string in DT.
The format of the Date/Time string Must be:
'dd-mon-yy hh:mm:ss'
Ex. '24-May-88 12:22:21' or ' 4-Jul-88 0:12:34'
SYNTAX
Procedure UnpackDateString(S:String;Var DT:DateTime);
EXAMPLES
VAR
S: String[18];
BEGIN
Write('Enter Date & Time <dd-mon-yy hh:mm:ss>');
Readln(s);
UnpackDateString(s,DT);
....
Opus System file interface Version 1.02 Nov 23, 1988
PackDateStrLog Function
DESCRIPTION
Make a string containing Date and Time in LOG format.
SYNTAX
Function PackDateStrLog(DT:DateTime): String;
Opus System file interface Version 1.02 Nov 23, 1988
AddLog Procedure
DESCRIPTION
Add a string to an OPUS log file using the correct format.
SYNTAX
Procedure AddLog(name:STRING; Flag: _StrSys; Subject: STRING);
EXAMPLE
AddLog('D:\Opus\Opus.Log','!','OPINT Here we go!');
Opus System file interface Version 1.02 Nov 23, 1988
SetAttrib Procedure
DESCRIPTION
This Procedure will change the attribute flag for an attribute
WARNING: 'Attribute' MUST be of type 'Word' or of Type 'Integer'..
Any other types are at Your own risk..
SYNTAX
Procedure SetAttrib(Var Attribute: Word; Flag: Word; Status:Boolean);
or
Procedure SetAttrib(Var Attribute: Integer; Flag: Word; Status:Boolean);
EXAMPLES
Var
MsgHead: _MsgHead;
Usr: _Usr;
BEGIN
....
SetAttrib(MsgHead._Attr,MsgHold,_On);
SetAttrib(MsgHead._Attr,MsgCrash,_Off);
SetAttrib(Usr.Flags,Usr_Ansi,_On);
....
Opus System file interface Version 1.02 Nov 23, 1988
ReadPrm Procedure
DESCRIPTION
ReadPrm reads the PRM file 'name' to a Variable of the type '_Prm'.
SYNTAX
Procedure ReadPrm(name:String; VAR Prm:_Prm);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
200 = .PRM file is to big ( > 8 KB )
201 = Wrong CTL file version, You need another OPUS_CTL
EXAMPLES
Var Prm:_Prm;
BEGIN
ReadPrm('D:\Opus\Opus.Prm',Prm);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WritePrm Procedure
DESCRIPTION
Write a Parameter file for OPUS <tm>
This procedure will change the opInt Error flag.
SYNTAX
Procedure WritePrm(name:String; VAR Prm:_Prm);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
201 = Wrong CTL file version, You need another OPUS_CTL
202 = To much data for the .PRM file ( > 8 KB )
EXAMPLES
Var Prm: _Prm;
.....
WritePrm('Opus.Prm',Prm);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadScheds Procedure
DESCRIPTION
ReadScheds reads a SCHEDULE file to a Vaiable of the type '_Scheds'
SYNTAX
Procedure ReadScheds(name:String; VAR Scheds:_Scheds);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
Var Scheds: _Scheds;
BEGIN
ReadScheds('Scheds.BBS',Scheds);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteScheds Procedure
DESCRIPTION
WriteScheds Writes a SCHEDULE file with the contents of a Vaiable
of the type '_Scheds'
SYNTAX
Procedure WriteScheds(name:String; VAR Scheds:_Scheds);
EXAMPLES
Var Scheds: _Scheds;
.....
WriteScheds('Scheds.BBS',Scheds);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadSys Procedure
DESCRIPTION
ReadSys reads a SYSTEM??.BBS file into a Vaiable of the type '_Sys'.
SYNTAX
Procedure ReadSys(name:String; VAR Sys:_Sys);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
Var Sys:_Sys;
BEGIN
ReadSys('System23.BBS',Sys);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteSys Procedure
DESCRITION
WriteSys writes a SYSTEM??.BBS file with the contents of a Vaiable
of the type '_Sys'.
SYNTAX
Procedure WriteSys(name:String; VAR Sys:_Sys);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
EXAMPLES
Var Sys: _Sys;
.....
WriteSys('System2.bbs',Sys);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadUser Procedure
DESCRIPTION
This procedure will read a user record from a user file to a variable
of the structure _Usr, it will return the user record number 'rec'
SYNTAX
Procedure ReadUser(name:String; VAR Usr:_Usr;Rec: WORD);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
220 = Cannot find User record
EXAMPLES
Var Usr, Usr2: _Usr;
RecordNumber: Word;
BEGIN
ReacordNumber:=1;
ReadUser('D:\Opus\User.BBS',Usr,RecordNumber);
IF opIntError > 0 THEN
....
ReadUser('LastUser.BBS',Usr2,1);
Opus System file interface Version 1.02 Nov 23, 1988
WriteUser Procedure
DESCRIPTION
This procedure will write a specified user record of the structure
'_Usr' to a user file, or it may add a record to the end of the user
file.
SYNTAX
Procedure WriteUser(name:String; VAR Usr:_Usr;Rec: WORD);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
220 = Cannot find User record
EXAMPLES
Var Usr: _Usr;
.....
WriteUsr('Uses.BBS',Usr,23);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
NumberOfUsers Function
DESCRIPTION
Will return the number of users in a userfile.
SYNTAX
Function NumberOfUsers(Name:String):Word;
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
Write('Number of Users on My BBS : ',NumberOfUsers('User.BBS');
Opus System file interface Version 1.02 Nov 23, 1988
InitUserPtr Procedure
DESCRIPTION
Initialise the UsrPointer.. Must be called if you create a new userfile
SYNTAX
Procedure InitUserPtr(VAR UsrPtr:_UsrPtr);
EXAMPLES
Var UsrPtr: _UsrPtr;
BEGIN
InitUserPtr(UsrPtr);
....
Opus System file interface Version 1.02 Nov 23, 1988
ReadUserFast Procedure
DESCRIPTION
This procedure will read all the user records from a variable of the
memory structure '_UsrPtr'.
SYNTAX
Procedure ReadUserFast(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Recs: INTEGER);
ERROR RETURNS
220 = Cannot find User record
EXAMPLES
Var Usr: _Usr;
UsrPtr: _UsrPtr;
BEGIN
ReadUserFast(UsrPtr,Usr,1);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteUserFast
DESCRIPTION
This procedure will write one of the user records into menory
SYNTAX
Procedure WriteUserFast(VAR UsrPtr:_UsrPtr;VAR Usr:_Usr; Recs: INTEGER);
ERROR RETURNS
220 = Cannot find User record
EXAMPLES
Var Usr: _Usr;
UsrPtr: _UsrPtr;
...
ReadUserFast(UsrPtr,Usr,1);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
ReleaseUserPtr Procedure
DESCRIPTION
Release the Heap space used by the UsrPointer.
SYNTAX
Procedure ReleaseUserPtr(VAR UsrPtr:_UsrPtr);
Opus System file interface Version 1.02 Nov 23, 1988
DelUserPtr
DESCRIPTION
Delete single user record from the User structure in Ram, and release
the heap space too.
SYNTAX
Procedure DelUserPtr(VAR UsrPtr:_UsrPtr; Rec:Integer);
Opus System file interface Version 1.02 Nov 23, 1988
InsUserPtr Procedure
DESCRIPTION
Insert new user record in the user structure in Ram.
SYNTAX
Procedure InsUserPtr(VAR UsrPtr:_UsrPtr; VAR Usr:_Usr; Rec:Integer);
Opus System file interface Version 1.02 Nov 23, 1988
ReadUserFile Procedure
DESCRIPTION
This procedure will read all user records from a user file into a _UsrPtr
structure in the menory.
SYNTAX
Procedure ReadUserFile(name:String; VAR UsrPtr:_UsrPtr; VAR Recs: INTEGER);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
221 = To Many Records In UserFile, Cannot handle it.
Var UsrPtr: _usrPtr;
Recs: Integer;
BEGIN
ReadUserFile('D:\Opus\User.BBS',UsrPtr,Recs);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteUserFile Procedure
DESCRIPTION
This procedure will write all the user records menory structure
_UsrPtr to a disk file.
SYNTAX
Procedure WriteUserFile(name:String; VAR UsrPtr:_UsrPtr);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
EXAMPLES
Var UsrPtr: _UsrPtr;
BEGIN
WriteUserFile('User.BBS',UsrPtr);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadNode Procedure
DESCRIPTION
Read a Nodelist type 5 record to a variable of the structure _Node.
SYNTAX
Procedure ReadNode(name:String; VAR Node:_Node;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
230 = Cannot find Nodelist Record
EXAMPLES
Var Node: _Node;
BEGIN
ReadNode('c:\Nodes\Nodelist.Sys',Node,13);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteNode Procedure
DESCRIPTION
This procedure will write a node record to a version 5 nodelist file.
SYNTAX
Procedure WriteNode(name:String; VAR Node:_Node;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
230 = Cannot find Nodelist Record
EXAMPLES
Var Node: _Node;
....
WriteNode('NODELIST.SYS',Node,12);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadNewNode Procedure
DESCRIPTION
Read a Nodelist Type 6 record to a variable of the structure _NewNode.
SYNTAX
Procedure ReadNewNode(name:String; VAR NewNode:_NewNode;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
230 = Cannot find Nodelist Record
EXAMPLES
Var NewNode: _NewNode;
BEGIN
ReadNewNode('c:\Nodes\Nodelist.Sys',NewNode,13);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteNewNode Procedure
DESCRIPTION
This procedure will write a node record to a version 6 nodelist file.
SYNTAX
Procedure WriteNewNode(name:String; VAR Node:_NewNode;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
230 = Cannot find Nodelist Record
EXAMPLES
Var NewNode: _NewNode;
....
WriteNewNode('NODELIST.SYS',NewNode,12);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
NumberOfNodes Function
DESCRIPTION
Will return the number of nodes in a nodelistfile.
SYNTAX
Function NumberOfNodes(Name:String):LongInt;
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
Write('Number of Nodes : ',NumberOfNodes('Nodelist.IDX');
Opus System file interface Version 1.02 Nov 23, 1988
FindNode Function
DESCRIPTION
This function will return the record number in the nodelist for the
selected node.
SYNTAX
Function FindNode(name:String;Net,Node: Integer):LongInt;
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
Var
Rec: Longint;
Net,Node: Integer;
BEGIN
Net:=230;
Node:=22;
Rec:=FindNode('c:\Nodes\Nodelist.Idx',Net,Node);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
ReadNdi Procedure
DESCRIPTION
This procedure will read a Ndi record from nodelist index file to a
variable of the structure _Ndi.
SYNTAX
Procedure ReadNdi(name:String; VAR Ndi:_Ndi;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
231 = Cannot find Nodelist Index Record
EXAMPLES
Var Ndi: _Ndi;
BEGIN
ReadNdi('D:\Opus\Nodelist.Idx',Ndi,5432);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteNdi Procedure
DESCRIPTION
This procedure will write a Node list index record of the structure
_Ndi to a nodelist index file
SYNTAX
Procedure WriteNdi(name:String; VAR Node:_Node;Rec: LongInt);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
231 = Cannot find Nodelist Index Record
EXAMPLES
Var Ndi: _Ndi;
.....
WriteNdi('Nodelist.Idx',Ndi,123456);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
MsgLength Function
DESCRIPTION
This function will return the number of charecters in a variable of the
structure _Msg.
SYNTAX
Function MsgLength(VAR Msg:_Msg):LongInt;
EXAMPLES
.....
IF MsgLength(Msg) > 1000 THEN
Write('This is an expensive message, hope it's good too !!');
Opus System file interface Version 1.02 Nov 23, 1988
ReadMsg Procedure
DESCRIPTION
This Procedure will read a message from disk into a variable of the
structure _Msg, the length of a message is limited to 8191 charecters,
or 300 lines (whatever you migth reach first).
This procedure will read both the message header and the message body.
SYNTAX
Procedure ReadMsg(name:String; VAR Msg:_Msg);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
210 = .MSG file is to big ( > 8 KB )
211 = To many lines in message
EXAMPLES
Var Msg: _Msg;
BEGIN
ReadMsg('D:\Mail\Asgaard\12.Msg',Prm);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteMsg Procedure
DESCRIPTION
This procedure will write the contents of a variable of the structure
Msg to a specified disk file.
SYNTAX
Procedure WriteMsg(name:String; VAR Msg:_Msg);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
212 = To many charecters to write message
EXAMPLES
Var Msg: _Msg;
.....
WriteMsg('D:\Mail\Agaard\23.MSG',Prm);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadMsgHead Procedure
DESCRIPTION
This procedure will read the message header from a message file. The
header will be read to a variable of the structure _Msg.
This procedure won't read the message body, so the read message will not
contain any lines.
SYNTAX
Procedure ReadMsgHead(name:String; VAR Msg:_Msg);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
210 = .MSG file is to big ( > 8 KB )
EXAMPLES
Var Msg: _Msg;
BEGIN
ReadMsgHead('D:\Mail\Asgaard\1.msg',Msg);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteMsgHead Procedure
DESCRIPTION
This procedure will rewite a the header of a message with the contents
of the structure _Msg.
Note: This procedure won't create a new message but return an error.
SYNTAX
Procedure WriteMsgHead(name:String; VAR Msg:_Msg);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
EXAMPLES
Var Msg: _Msg;
.....
WriteMsgHead('D:\mail\asgaard\1.msg',Msg);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
ReadMsgHeadNew Procedure
DESCRIPTION
This procedure will read the message header from a message file. The
header will be read to a variable of the structure _MsgHead.
SYNTAX
Procedure ReadMsgHeadNew(name:String; VAR MsgHead:_MsgHead);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
210 = .MSG file is to big ( > 8 KB )
EXAMPLES
Var MsgHead: _MsgHead;
BEGIN
ReadMsgHeadNew('D:\Mail\Asgaard\1.msg',MsgHead);
IF opIntError > 0 THEN
....
Opus System file interface Version 1.02 Nov 23, 1988
WriteMsgHeadNew Procedure
DESCRIPTION
This procedure will rewite a the header of a message with the contents
of the structure _MsgHead.
Note: This procedure won't create a new message but return an error.
SYNTAX
Procedure WriteMsgHeadNew(name:String; VAR MsgHead:_MsgHead);
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
101 = Disk write error.
EXAMPLES
Var Msg: _Msg;
.....
WriteMsgHeadNew('D:\mail\asgaard\1.msg',MsgHead);
IF OpIntError > 0 THEN
.....
Opus System file interface Version 1.02 Nov 23, 1988
FirstFreeMsg Function
DESCRIPTION
This Function will return the first free message number in the area
described by a path.
The path used when called will be placed in front of the filename.
If no path is used the function will return the number for the current
directory.
Here is some examples: (lets say there is 98 messages in each area)
PATH FIRST FREE
'd:\msg\test' --> 'd:\msg\test\99.msg'
'd:\msg\test\' --> 'd:\msg\test\99.msg'
'd:' --> 'd:\99.msg'
'.' --> '.\99.msg'
'.\' --> '.\99.msg'
'..\msg\test' --> '..\msg\test\99.msg'
'' --> '99.msg'
SYNTAX
Function FirstFreeMsg(Path:String):String;
ERROR RETURNS
0 = Everything is Bright and Sunny, Just go on
2 = File not found, Check your filename
3 = Path not found, Check your pathname
4 = Too many open files, We need one extra file.
5 = Fileaccess denied, Check file status.
12 = Invalid file acces code.
100 = Disk read error.
EXAMPLES
...
S:=FirstFreeMsg('d:\msg\test\');
WriteMsg(S,Msg);
...
Opus System file interface Version 1.02 Nov 23, 1988
KeyPressed Function
DESCRIPTION
This function is true if there is a character available on the
standard input device.
SYNTAX
Function KeyPressed: Boolean;
EXAMPLES
Program Test1;
Uses OpInt;
BEGIN
IF KeyPressed THEN
Write('SomeOne pressed a key');
END;
Program test2;
Uses Crt,OpInt; {Note the last listed will take precedence}
BEGIN
IF KeyPressed THEN {The OpInt.KeyPressed function}
Write('SomeOne pressed a key');
IF Crt.KeyPressed THEN {Here is how to call Crt.KeyPressed}
Write('SysOp pressed a key on the console');
END.
Opus System file interface Version 1.02 Nov 23, 1988
ReadKey Function
DESCRIPTION
This function will return a character from the standard input device.
SYNTAX
Function ReadKey: Char;
ERROR RETURNS
IOResult will be effected.
EXAMPLES
Program Test1;
Uses OpInt;
BEGIN
Write(ReadKey);
END;
Program test2;
Uses Crt,OpInt; {Note the last listed will take precedence}
BEGIN
Writeln(ReadKey); {Use ReadKey from OpInt}
Writeln(OpInt.ReadKey);{This will do the same}
Writeln(Crt.ReadKey); {Here is how to call Crt.ReadKey}
END.
Opus System file interface Version 1.02 Nov 23, 1988
GotoXY Procedure
DESCRIPTION
This procedure will move the cursor at the standard output to the
selected position. Please notice that this function uses the ANSI.SYS
device driver. If the you are redirecting the StdOut to a com port the
terminal emulator in the other end must be able to handle Ansi escape
sequences.
SYNTAX
Procedure GotoXY(X,Y: Byte);
ERROR RETURNS
EXAMPLES
BEGIN
GotoXY(1,2);
....
Program Test1;
Uses OpInt;
BEGIN
GotoXY(1,2); {Use ReadKey from OpInt}
END;
Program test2;
Uses Crt,OpInt; {Note the last listed will take precedence}
BEGIN
GotoXY(1,2); {Use GotoXY from OpInt}
Crt.GotoXY(1,2); {Here is how to call Crt.ReadKey}
Opus System file interface Version 1.02 Nov 23, 1988
PurgeInFossil Procedure
DESCRIPTION
This procedure will delete all charecters from the Com port input
buffer. Before using this function the text file must be oppened with
the AssignFossil procedure.
SYNTAX
Procedure PurgeInFossil(VAR F:TEXT);
ERROR RETURNS
EXAMPLES
Var F:TEXT;
BEGIN
AssignFossil(F,0,0);
PurgeInFossil(F);
....
Opus System file interface Version 1.02 Nov 23, 1988
PurgeOutFossil Procedure
DESCRIPTION
This procedure will delete everything in the Fossil output buffer.
SYNTAX
Procedure PurgeOutFossil(VAR F:Text);
ERROR RETURNS
EXAMPLES
Var F:TEXT;
BEGIN
AssignFossil(F,0,0);
PurgeOutFossil(F);
....
Opus System file interface Version 1.02 Nov 23, 1988
FossilCarrier Function
DESCRIPTION
This function will be true if there are carrier on the selected COM
port.
SYNTAX
Function FossilCarrier(VAR F:TEXT): Boolean;
ERROR RETURNS
EXAMPLES
Opus System file interface Version 1.02 Nov 23, 1988
FossilPressed Function
DESCRIPTION
This function will be true if there is a character available in the
input buffer for the selected COM device.
SYNTAX
Function FossilPressed(VAR F:TEXT): Boolean;
ERROR RETURNS
EXAMPLES
Opus System file interface Version 1.02 Nov 23, 1988
GotoXYFossil Procedure
DESCRIPTION
This procedure will move the cursor at the selected device to the
selected position. Please notice that this function uses ANSI control
codes and the terminal emulator must be able to handle this.
SYNTAX
Procedure GotoXYFossil(VAR F: Text;X,Y: Byte);
ERROR RETURNS
EXAMPLES
....
GotoXYFossil(Com1,1,2);
....
Opus System file interface Version 1.02 Nov 23, 1988
ReadFossil Function
DESCRIPTION
This function will return a character from the port conected to the
Text File Device.
SYNTAX
Function ReadFossil(VAR F:TEXT): Char;
ERROR RETURNS
IOResult will be effected.
EXAMPLES
VAR F: TEXT;
BEGIN
...
Write(ReadFossil(F));
....
Opus System file interface Version 1.02 Nov 23, 1988
AssignFossil Procedure
DESCRIPTION
This procedure is used to make at text file device driver for a
selected communications port, at a selected baud rate.
When assigned the device will get the Default modes as set in the
variables '_Snoop', '_Keyboard' and '_ExitCarrier'
SYNTAX
AssignFossil(VAR F:Text; Port,Baud: Word);
ERROR RETURNS
EXAMPLES
VAR A,B: Text;
BEGIN
_Snoop:=_Off; { Don't print to the screen }
_Keyboard:=_Off; { Don't read from the KeyBoard }
_ExitCarrier:=1; { Exit if Carrier changes withh Errlevel 1 }
AssignFossil(A,0,0); { Assign 'A' to port 0, don't change baudrate }
_Snoop:=_On; { Let's have a look at this fellow }
AssignFossil(B,1,300); { Assign 'B' to port 1 at 1200 Baud }
...
Opus System file interface Version 1.02 Nov 23, 1988
SetSnoopFossil Procedure
DESCRIPTION
Change the Snoop mode for a Text file device driver.
SYNTAX
Procedure SetSnoopFossil(VAR F:Text, _Snoop: Boolean);
EXAMPLES
VAR ComIn: Text;
...
SetSnoopFossil(ComIn,_On); { _On := True; _Off:=False }
Opus System file interface Version 1.02 Nov 23, 1988
SetKeyboardFossil Procedure
DESCRIPTION
Change the Keyboard mode for a Text file device driver.
Notice that if you enable the keyboard mode you will enable the Snoop
mode too.
SYNTAX
Procedure SetKeyboardFossil(VAR F:Text, _Keyboard: Boolean);
EXAMPLES
VAR ComIn: Text;
...
SetKeyboardFossil(ComIn,_On); { _On := True; _Off:=False }
Opus System file interface Version 1.02 Nov 23, 1988
SetExitFossil Procedure
DESCRIPTION
Change the exit code for changed carrier, or disable this function.
SYNTAX
Procedure SetExitFossil(VAR F:Text, _Exit: Byte);
EXAMPLES
VAR ComIn: Text;
...
SetSnoopFossil(ComIn,5); { 0 : Don't exit; >0 : Exit with this code}
Opus System file interface Version 1.02 Nov 23, 1988
UseInOut Procedure
DESCRIPTION
This procedure will change the devices 'Input' and 'Output' to use
the selected port at the selected speed.
The variables '_Snoop', '_Keyboard' and '_ExitCarrier' will set
the default Snoop, keyboard and ExitOnCarrier modes..
You may change these modes using the procedures 'SetSnoopFissil',
'SetKeyboardFossil' and 'SetExitFossil' to change the modes, but
must use these on both 'Input' and 'Output'.
SYNTAX
Procedure UseInOut(Port, Baud: Word);
ERROR RETURNS
EXAMPLES
BEGIN
UseInOut(1,1200); { Assign for COM2 at 1200 baud }
WriteLn('Hello out there, how are you');
readln; { Wait for someone to press enterr }
...
Opus System file interface Version 1.02 Nov 23, 1988
UnUseInOut Procedure
DESCRIPTION
UnInstall the text file device drivers for standard input and output.
SYNTAX
Procedure UnUseInOut;
ERROR RETURNS
EXAMPLES
BEGIN
UseInOut(1,1200); { Assign for COM2 at 1200 baud }
WriteLn('Hello, how are you');
readln;
UnUseInOut;
Writeln('This is just for the SysOp console');
...